# -*- coding: utf-8 -*-
import datetime
from django.db import models
from salones.clientes.choices import genero

# Create your models here.
class Localidades(models.Model):
	nombre= models.CharField(max_length=50, unique=True)
	codigo_postal = models.CharField(max_length=10)
	def __unicode__(self):
			return self.nombre

class Clientes(models.Model):
	nombre= models.CharField(max_length=30, unique=False)
	apellido= models.CharField(max_length=30, unique=False)
	tel_movil= models.CharField(max_length=15, unique=True)
	tel_fijo= models.CharField(max_length=15, unique=False)
	direccion= models.CharField(max_length=50, unique=False)
	localidad= models.ForeignKey(Localidades)
	email= models.EmailField(max_length=50, unique=True)
	genero= models.CharField(choices=genero, max_length=1, default=0)
	fecha_nacimiento = models.DateField(null=True)
	def __unicode__(self):
		return self.nombre + " " + self.apellido
	def get_genero(self):
		return genero[int(self.genero)][1]

class Slim(models.Model):
	cliente= models.ForeignKey(Clientes)
	nombre= models.CharField(max_length=15, unique=False)
	valor= models.CharField(max_length=50, unique=False)